#!/usr/bin/env bash

set -ve

export LFS='/mnt/lfs'

_USER=`whoami`
if [ "$_USER" != "lfs" ];
then
    echo 'WARNING: User lfs ONLY!!!' && exit;
fi

############################## Expect ###############################

cd $LFS/sources/
rm -rf expect5.45.4/
tar -xvf expect5.45.4.tar.gz
cd expect5.45.4/

cp -v configure{,.orig}
sed 's:/usr/local/bin:/bin:' configure.orig > configure

./configure --prefix=/tools       \
            --with-tcl=/tools/lib \
            --with-tclinclude=/tools/include
make
# 测试
make test
# SCRIPTS 参数是为了避免安装额外的、没有需求的 Expect 脚本。
make SCRIPTS="" install
